from small one page howto to huge articles all in one place
 

search text in:





Poll
Which screen resolution do you use?










poll results

Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

195647

userrating:

average rating: 1.7 (102 votes) (1=very good 6=terrible)


May 25th. 2007:
Words

486

Views

252053

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

140917

userrating:

average rating: 1.4 (42 votes) (1=very good 6=terrible)


April, 26th. 2006:

Druckversion . pdf icon
You are here: System->Tips and Tricks

Converting data with units

This short tutorial shows you how to use the units command which is a nifty utility that converts quantities between scales (e.g. meters to feet or kilograms to pounds). While not an essential tool, it can certainly be convenient at times.

Code Listing 1: Getting units

# emerge app-sci/units 
or 
apt-get install units 
or ...

There are two ways to use the units command, interactively and non-interactively. To use it interactively, simply issue the command units.

Code Listing 2: Using units interactively

% units 
1948 units, 71 prefixes, 28 functions 
 
You have: 1 meter 
You want: feet 
        * 3.2808399 
        / 0.3048 
You have: 3 kilograms 
You want: pounds 
        * 6.6138679 
        / 0.15119746

The first number (prefixed by a *) indicates the conversion as you specified (i.e. there are about 3.28 feet in a meter). The second number is the conversion in the opposite direction (i.e. there are about 0.3 meters in a foot).

To use units non-interactively, issue the command followed by the original expression and then the new expression.

Code Listing 3: Using units non-interactively

// How many pecks are in a bushel? 
% units '1 bushel' 'peck' 
        * 4 
        / 0.25 
 
// How many miles per hour are in a knot? 
% units '1 knot' 'mph' 
        * 1.1507794 
        / 0.86897624

Note: A 'knot' is one nautical mile per hour.

See the man page (man units) for more information on the units command.

From http://www.gentoo.org/news/en/gwn/20030825-newsletter.xml


rate this article:
current rating: average rating: 1.3 (27 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2020 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 115.9 ms